import re

ifconfig = '''ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.50.175  netmask 255.255.255.0  broadcast 192.168.50.255
        inet6 fe80::250:56ff:feab:b5b7  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:ab:b5:b7  txqueuelen 1000  (Ethernet)
        RX packets 1591  bytes 204304 (199.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1075  bytes 96081 (93.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0'''

re_findall_result = re.findall('([a-z0-9]{2}:[a-z0-9]{2}:[a-z0-9]{2}:[a-z0-9]{2}:[a-z0-9]{2}:[a-z0-9]{2})',ifconfig)


print('{0:<} : {1:<}'.format('MAC地址为',re_findall_result[0]))


#MAC地址为 : 00:50:56:ab:b5:b7